package com.huawei;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * Description: HJ1 字符串最后一个单词的长度
 *
 * @author weiruibai.vendor
 * Date: 2022/8/5 16:56
 */
public class HJ1 {

    public static void main(String[] args) {
        test2();
    }

    private static void test1() {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int length = str.length();
        int count = 0;
        for (int i = length - 1; i >= 0; i--) {
            if (str.charAt(i) == ' ') { // 或者 if (str.substring(i, i + 1).equals(" ")) {
                break;
            }
            count++;
        }
        System.out.println(count);
    }

    private static void test2() {
        Scanner scanner = new Scanner(System.in);
        String str;
        while (scanner.hasNextLine()) {
            str = scanner.nextLine();
            String[] strs = str.split(" ");
            System.out.println(strs[strs.length - 1].length());
        }
    }

    private static void test3() throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = reader.readLine()) != null && str != "") {
            String[] strs = str.split(" ");
            System.out.println(strs[strs.length - 1].length());
        }
    }
}
